Math.round Method

Rounds a double-precision floating-point value to a specified number of fractional digits.
 
 
Static This method is static.

Parameters

value

Type: Number
A double-precision floating-point number to be rounded.
digits

Type: Number (Integer)
The number of fractional digits in the return value, or do not specify to round to the nearest integral value.
Optional: True

Return Value


Type: Number
The number nearest to value that contains a number of fractional digits equal to digits or an integer if none specified.